/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Com.HallRenting_Case;

import Com.Entity.TransaksiGedung;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author Ignacio
 */
public class jadwalTabelModel extends AbstractTableModel {
private List<TransaksiGedung> jadwalList = new ArrayList<TransaksiGedung>();
    public jadwalTabelModel(List<TransaksiGedung> jadwalList){
       this.jadwalList=jadwalList;
    }
    @Override
    public int getRowCount() {
        return jadwalList.size();
    }

    @Override
    public int getColumnCount() {
       return 5;
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        TransaksiGedung tg = jadwalList.get(rowIndex);
        switch (columnIndex) {
            case 0: 
                return tg.getTanggalSewa();
            case 1:
                return tg.getNama_penyewa();
            case 2:
                return tg.getJamSewa();
            case 3:
                return tg.getJamKeluar();
            case 4:
                return tg.getJenisGedung();
            default:
                return "";
        }
    }
    @Override
    public String getColumnName(int column){
        switch(column){
            case 0:
                return "TANGGAL SEWA";
            case 1:
                return  "NAMA PENYEWA";
            case 2:
                return "JAM SEWA";
            case 3:
                return "JAM KELUAR";
            case 4:
                return "JENIS GEDUNG";
            default:
                return "";
                
        }
    }
    
}
